package com.yjc.drygoods.ware.feign;

import com.yjc.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;

/**
 * @author yjc
 * @create 2022-09-03 16:26
 */
@FeignClient("drygoods-product")
public interface ProductFeignService {
    @RequestMapping("/product/skuinfo/info/{skuId}")
    R info(@PathVariable("skuId") Long skuId);

    @RequestMapping("/product/spuinfo/info/{spuId}")
    R spuInfo(@PathVariable("spuId") Long spuId);

    @GetMapping("/product/category/get/total/catelogPathWithSpuId/{spuId}")
    R getTotalCatelogPathWithSpuId(@PathVariable("spuId") Long spuId);

    @GetMapping("/product/skuinfo/update/reducedPrice")
    R updateReducedPrice(@RequestParam Long spuId, @RequestParam BigDecimal reducedPrice);

    @GetMapping("/product/spucomment/get/all/spuComments/avgStar")
    public R getAllSpuComments();
}
